Skip to content

Improve sheet cutting layouts with strategies and edge trim - #47

Open
Maaxion wants to merge 1 commit into
BenchUp3D:mainfrom
Maaxion:cutlist-improvements
Open

Maaxion wants to merge 1 commit into
BenchUp3D:mainfrom
Maaxion:cutlist-improvements

Conversation

@Maaxion

@Maaxion Maaxion commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

One-line description

Pack cutting plans more tightly, and add a layout strategy and an edge trim setting to the cutting plan dialog.

Changes in detail

  • The packer tries several piece orders and split rules and keeps the best layout. The first candidate is the existing packing, so a plan never needs more sheets than before.
  • New "Layout strategy" setting:
    • "Fewest sheets" is the default.
    • "Rip first" makes full-length rips along the stock, then crosscuts only inside each strip.
    • "Largest offcut" keeps the layout that leaves the largest single empty rectangle, with the kerf counted as lost.
  • New "Edge trim" setting, 0 to 100 mm, removed from each side of a sheet. It applies only to stock at least 600 mm in both directions, so boards are never trimmed.
  • Both settings are in the cutting plan dialog with hover text, and are saved with the other layout settings. Settings saved before this change load with the defaults.
  • Grain and joinery handling is unchanged: a grained part still cannot rotate when "Respect wood grain direction" is on, under every strategy.
  • Note: with the default strategy, the layout of an existing project can differ from 0.7.1 even when the sheet count is the same, because ties between candidates go to the layout with fewer leftover pieces.
  • Text keys added to en, pt_BR and zh_CN.

Testing

  • New tests in cutting_layout_tests.rs: quantities, bounds and kerf for every strategy, best-of never using more sheets than the original ordering, deterministic output, two-stage and full-length rips, the largest empty rectangle value, grain never rotating, edge trim on sheets and not on boards, and old settings loading with defaults. The existing layout tests pass unchanged.
  • Strategy and edge trim added to the preference regression list in sidebar.rs.
  • Ran the benchup-app library tests on this commit: the branch adds no failures compared with main.
  • cargo check for wasm32-unknown-unknown is free of warnings.
  • Tested by hand in the desktop app.

Try several piece orders and split rules and keep the layout with the fewest sheets. Add a layout strategy setting (fewest sheets, rip first, largest offcut) and an edge trim margin for sheet goods, both in the cut dialog and saved with the other layout settings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant